#include "dma.h"


void MX_DMA_Init(void){

  /* DMA controller clock enable */
  RCC->AHBENR|=RCC_AHBENR_DMA1EN;

  
  HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 7, 0);
  HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);

  HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 7, 0);
  HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);

  HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 7, 0);
  HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);

}

void MX_DMA_DeInit(){

  HAL_NVIC_DisableIRQ(DMA1_Channel3_IRQn);
  HAL_NVIC_DisableIRQ(DMA1_Channel4_IRQn);
  HAL_NVIC_DisableIRQ(DMA1_Channel5_IRQn);

  RCC->AHBENR&=(~RCC_AHBENR_DMA1EN);

}
